home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / daten / twistdemo / organiser / dialnumberphome.rexx < prev    next >
OS/2 REXX Batch file  |  1995-02-22  |  2KB  |  69 lines

  1. /* This arexx script calculates a total field from all related track records */
  2. GETDBFORMFIELD
  3.  
  4. ADDRESS twist
  5. PARSE ARG dbfilename,rela_x,rela_y,shiftkeys
  6. OPEN dbfilename
  7. options results
  8. GETDBFORMMODE
  9. if results != "EDIT" then EXIT
  10.  
  11. tottime = 0
  12.  
  13. GETDBFORMFIELD "tracks.duration"
  14. timestr = result
  15. if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2)
  16.  
  17. GETDBFORMFIELD "tracks_2.duration"
  18. timestr = result
  19. if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2)
  20.  
  21. GETDBFORMFIELD "tracks_3.duration"
  22. timestr = result
  23. if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2)
  24.  
  25. GETDBFORMFIELD "tracks_4.duration"
  26. timestr = result
  27. if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2)
  28.  
  29. GETDBFORMFIELD "tracks_5.duration"
  30. timestr = result
  31. if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2)
  32.  
  33. GETDBFORMFIELD "tracks_6.duration"
  34. timestr = result
  35. if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2)
  36.  
  37. GETDBFORMFIELD "tracks_7.duration"
  38. timestr = result
  39. if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2)
  40.  
  41. GETDBFORMFIELD "tracks_8.duration"
  42. timestr = result
  43. if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2)
  44.  
  45. GETDBFORMFIELD "tracks_9.duration"
  46. timestr = result
  47. if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2)
  48.  
  49. GETDBFORMFIELD "tracks_10.duration"
  50. timestr = result
  51. if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2)
  52.  
  53. GETDBFORMFIELD "tracks_11.duration"
  54. timestr = result
  55. if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2)
  56.  
  57. GETDBFORMFIELD "tracks_12.duration"
  58. timestr = result
  59. if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2)
  60.  
  61. minutes = tottime%60;
  62. secs = tottime // 60
  63. if minutes >= 10 then timestr = minutes
  64. else timestr = "0" || minutes
  65. if secs >= 10 then timestr = timestr || ":" || secs
  66. else timestr = timestr || ":0" || secs 
  67.  
  68. SETDBFORMFIELD "total_time" timestr
  69.